#pragma once

#include <map>
#include "Behaviour.h"

namespace game_engine { namespace library
{

// Forward declarations
class TPCidle;
class TPCwalking;

//enum Direction
//{
//    EAST        = 0,
//    NORTH_EAST  = 1,
//    NORTH       = 2,
//    NORTH_WEST  = 3,
//    WEST        = 4,
//    SOUTH_WEST  = 5,
//    SOUTH       = 6,
//    SOUTH_EAST  = 7,
//    IDLE        = 8,
//};

/*!
 * \class ThirdPersonController
 * \brief 
 */
class ThirdPersonController : public game_engine::components::Behaviour
{
///////////////////////////////////////////////////////////////////////////////
// Attribute definition
///////////////////////////////////////////////////////////////////////////////
private:
    string idleAnimationId;
    map<Direction,string> walkAnimationId;
    map<Direction,string> runAnimationId;
    map<Direction,string> jumpAnimationId;
    FLOAT32 walkSpeed;
    FLOAT32 runSpeed;
    BOOL canJump;
    library::TPCidle *idleState;
    library::TPCwalking *walkingState;
    Direction prevDirection;
    BOOL directionUpdated;

///////////////////////////////////////////////////////////////////////////////
// Method definition
///////////////////////////////////////////////////////////////////////////////
public:
    // Constructors and Destructors
    ThirdPersonController(void);
    ThirdPersonController(GameObject *obj);
    virtual ~ThirdPersonController(void);

    // Others
    void initialize(void) throw(...);

    // Getters
    const string& getIdleAnimationId(void) const;
    const string getWalkAnimationId(const Direction direction) const;
    const FLOAT32 getWalkSpeed(void) const;
    const Direction getPrevDirection(void);
    const BOOL getDirectionUpdated(void) const;

    // Setters
    void setIdleAnimationId(const string &animId);
    void setWalkAnimationId(const Direction direction, const string &animId);
    //void setRunAnimationId(const string &animId);
    //void setJumpAnimationId(const string &animId);
    void setWalkSpeed(const FLOAT32 speed);
    void setRunSpeed(const FLOAT32 speed);
    void setCanJump(const BOOL flag);
    void setPrevDirection(const Direction dir);

};

}}
